import 'package:flutter/material.dart';
import 'package:shopping_group/utils/route_util.dart';

class ImageDailogView extends StatefulWidget {
  final String path;
  const ImageDailogView({Key key, this.path}) : super(key: key);

  @override
  _ImageDailogViewState createState() => _ImageDailogViewState();
}

class _ImageDailogViewState extends State<ImageDailogView> {
  @override
  Widget build(BuildContext context) {
    return _showView();
  }

  Widget _showView() {
    return GestureDetector(
      onTap: () {
        RouteUtil.closeView();
      },
      child: Container(
          margin: const EdgeInsets.all(5.0),
          child: Material(
            borderRadius: BorderRadius.circular(0.0),
            shadowColor: Colors.blue.shade200,
            color: Colors.white,
            elevation: 0.0,
            child: FadeInImage.assetNetwork(
              image: this.widget.path,
              placeholder: 'images/picture_loading.png' /* 指定gif */,
              fit: BoxFit.contain,
            ),
          )),
    );
  }
}
